Component({
  externalClasses: ['wux-class','wux-arrow-class'],
  relations: {
    '../accordion-group/index': {
      type: 'parent',
    },
  },
  properties: {
    key: {
      type: String,
      value: '',
    },
    thumb: {
      type: String,
      value: '',
    },
    title: {
      type: String,
      value: '',
    },
    des: {
      type: String,
      value: '',
    },
    content: {
      type: String,
      value: '',
    },
    disabled: {
      type: Boolean,
      value: false,
    },
    tall: {
      type: Boolean,
      value: false
    },
    talls: {
      type: Boolean,
      value: false
    },
    help: {
      type: Boolean,
      value: false
    },
    bg: {
      type: String,
      value: ''
    },
    last: {
      type: Boolean,
      value: false
    }
  },
  data: {
    current: false,
    index: '0',
  },
  methods: {
    changeCurrent(current, index) {
      this.setData({
        current,
        index,
      })
    },
    onTap() {
      const {
        index,
        disabled
      } = this.data
      const parent = this.getRelationNodes('../accordion-group/index')[0]

      if (disabled || !parent) {
        return false
      }
      parent.onClickItem(index)
    },
  },
})